import request from '@/utils/request'

// 查询地市列表
export function listRegion(query) {
  return request({
    url: '/system/region/list',
    method: 'get',
    params: query
  })
}

// 查询地市列表（排除节点）
export function listRegionExcludeChild(regId) {
  return request({
    url: '/system/region/list/exclude/' + regId,
    method: 'get'
  })
}

// 查询地市详细
export function getRegion(regId) {
  return request({
    url: '/system/region/' + regId,
    method: 'get'
  })
}

// 新增地市
export function addRegion(data) {
  return request({
    url: '/system/region',
    method: 'post',
    data: data
  })
}

// 编辑地市
export function updateRegion(data) {
  return request({
    url: '/system/region',
    method: 'put',
    data: data
  })
}

// 删除地市
export function delRegion(regId) {
  return request({
    url: '/system/region/' + regId,
    method: 'delete'
  })
}

// 查询城市列表
export function getRegionList(pregId) {
  return request({
    url: '/system/region/getRegion/' + pregId,
    method: 'get'
  })
}